<template>
	<view class="">
		<!-- 顶部自定义导航 -->
		<tn-nav-bar fixed alpha customBack>
			<view slot="back" class='tn-custom-nav-bar__back' @click="goBack">
				<text class='icon tn-icon-left'></text>
				<text class='icon tn-icon-home-capsule-fill'></text>
			</view>
		</tn-nav-bar>
		
		<view class="" :style="{paddingTop: vuex_custom_bar_height + 'px'}">
		
		
			<!-- <block v-for="(item, index) in navList" :key="index"> -->
				<!-- <view class="nav_title--wrap tn-margin-bottom-sm"> -->
					<!-- <view class="nav_title tn-cool-bg-color-15">{{ item.title | titleFilter}}</view> -->
				<!-- </view> -->
		
				<view class='nav-list'>
					<block v-for="(content_item, content_index) in list" :key="content_index">
						<view hover-class='none' @click="clickMenu(content_item)"
							class="nav-list-item tn-shadow-blur tn-cool-bg-image" :style="'background-color: '+content_item.bg_color + ';'">
							<view class="nav-link">
								<view class='title'>{{ content_item.title }}</view>
								<view class='author'> <text class="tn-icon-code tn-padding-right-xs"></text> 
								</view>
							</view>
						</view>
					</block>
				</view>
			<!-- </block> -->
		
		</view>
	</view>
</template>

<script>
	import template_page_mixin from '@/libs/mixin/template_page_mixin.js'
	import { seriesList } from '@/utils/api/image'
	export default {
		name: 'ImageCategory',
		mixins: [template_page_mixin],
		data() {
			return {
				list: []
			}
		},
		onLoad() {
			this.getImageSeriesList()
		},
		methods: {
			clickMenu(item) {
				uni.navigateTo({
					url: '/pageA/wallpaper/wallpaper?series_uid=' + item.uid
				})
			},
			getImageSeriesList() {
				uni.showLoading({
					title: "努力加载中",
					mask: true,
				})
				seriesList().then(res => {
					this.list = res.items
					uni.hideLoading()
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	@import "@/scss/custom_nav_bar.scss";
	/* 标题start */
	.nav_title {
		-webkit-background-clip: text;
		color: transparent;

		&--wrap {
			position: relative;
			display: flex;
			height: 120rpx;
			font-size: 46rpx;
			align-items: center;
			justify-content: center;
			font-weight: bold;
			background-image: url(https://tnuiimage.tnkjapp.com/title_bg/title44.png);
			background-size: cover;
		}
	}

	/* 标题end */

	/* 组件导航列表 start*/
	.nav-list {
		display: flex;
		flex-wrap: wrap;
		padding: 0rpx 12rpx 0rpx;
		justify-content: space-between;

		/* 列表元素 start */
		.nav-list-item {
			padding: 0rpx 30rpx 15rpx 30rpx;
			border-radius: 12rpx;
			width: 45%;
			height: 180rpx;
			margin: 0 18rpx 40rpx;
			background-size: cover;
			background-position: center;
			position: relative;
			z-index: 99;



			/* 元素标题 start */
			.nav-link {
				font-size: 32rpx;
				text-transform: capitalize;
				padding: 25rpx 0 10rpx 0;
				position: relative;

				.title {
					font-weight: bold;
					font-size: 36rpx;
					color: #FFFFFF;
					margin-top: 30rpx;
					text-align: center;
				}

				.author {
					font-size: 25rpx;
					color: #FFFFFF;
					margin-top: 10rpx;
					margin-left: -10rpx;
					text-align: center;
				}
			}

			/* 元素标题 end */

			/* 元素图标 start */
			.icon {
				font-variant: small-caps;
				position: absolute;
				top: 20rpx;
				right: 50rpx;
				left: 37%;
				width: 90rpx;
				height: 90rpx;
				line-height: 90rpx;
				margin: 0;
				padding: 0;
				display: inline-flex;
				text-align: center;
				justify-content: center;
				vertical-align: middle;
				font-size: 50rpx;
				color: #FFFFFF;
				white-space: nowrap;
				opacity: 0.9;
				background-color: rgba(0, 0, 0, 0.05);
				background-size: cover;
				background-position: 50%;
				border-radius: 5000rpx;
			}

			/* 元素图标 end */
		}

		/* 列表元素 end */
	}

	/* 组件导航列表 end*/
</style>